]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
layout: Set initial visibility of fullscreen-tracking chrome
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 14 May 2015 15:33:24 +0000 (17:33 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 21 May 2015 11:58:49 +0000 (13:58 +0200)
When chrome is added with the trackFullscreen parameter, the actor's
visibility will be updated automatically whenever its monitor's
fullscreen state changes. However as we currently ignore the fullscreen
state at the time the chrome is added, the initial visibility may well
be incorrect - fix this by updating the initial visibility as necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=749383

js/ui/layout.js

index d5780e523f15dfee32249bf1fe6c28a8e7af548b..7ec6867093edf060aad0e664d35e2fdaa1681203 100644 (file)
@@ -837,6 +837,7 @@ const LayoutManager = new Lang.Class({
         // need to connect to 'destroy' too.
 
         this._trackedActors.push(actorData);
+        this._updateActorVisibility(actorData);
         this._queueUpdateRegions();
     },
 
@@ -855,25 +856,23 @@ const LayoutManager = new Lang.Class({
         this._queueUpdateRegions();
     },
 
+    _updateActorVisibility: function(actorData) {
+        if (!actorData.trackFullscreen)
+            return;
+
+        let monitor = this.findMonitorForActor(actorData.actor);
+        actorData.actor.visible = !(global.window_group.visible &&
+                                    monitor &&
+                                    monitor.inFullscreen);
+    },
+
     _updateVisibility: function() {
         let windowsVisible = Main.sessionMode.hasWindows && !this._inOverview;
 
         global.window_group.visible = windowsVisible;
         global.top_window_group.visible = windowsVisible;
 
-        for (let i = 0; i < this._trackedActors.length; i++) {
-            let actorData = this._trackedActors[i], visible;
-            if (!actorData.trackFullscreen)
-                continue;
-
-            if (!windowsVisible)
-                visible = true;
-            else if (this.findMonitorForActor(actorData.actor).inFullscreen)
-                visible = false;
-            else
-                visible = true;
-            actorData.actor.visible = visible;
-        }
+        this._trackedActors.forEach(Lang.bind(this, this._updateActorVisibility));
     },
 
     getWorkAreaForMonitor: function(monitorIndex) {